package auto;

import config.ConnectionProperties;
import connection.IDbUtil;
import connection.impl.DbUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.sql.Driver;

/**
 * 1 读取数据源配置
 * **/
@Configuration
@EnableConfigurationProperties(ConnectionProperties.class)
@ConditionalOnClass({Driver.class, IDbUtil.class})
public class DbAutoConfiguration {
    @Bean
    public IDbUtil iDbUtil() {
        return new DbUtil();
    }
}
